home *** CD-ROM | disk | FTP | other *** search
/ Delphi Informant Complete 1995 - 2000 / Delphi Informant Complete 1995 to 2000.iso / Delphi Informant Magazine Complete Works SOURCE CODE 1998.rar / 1998 / Jan / di9801kw / PropExpl.dpr < prev    next >
Text File  |  1997-07-29  |  3KB  |  110 lines

  1. library PropExpl;
  2.  
  3. {
  4.   Property Explorer.
  5.  
  6.   Locates properties names and/or contents that have a given value.
  7.  
  8.   Written by Keith Wood, 20 March 1997.
  9.   Version 1.0
  10. }
  11.  
  12. uses
  13.   ShareMem,
  14.   Forms,
  15.   WinTypes,
  16.   ExptIntf,
  17.   ToolIntf,
  18.   VirtIntf,
  19.   SysUtils,
  20.   WinProcs,
  21.   PropExp1 in 'PropExp1.pas' {frmPropExplorerExpert};
  22.  
  23. type
  24.   TPropExplorerExpert = class(TIExpert)
  25.     function GetName: string; override;
  26.     function GetMenuText: string; override;
  27.     function GetStyle: TExpertStyle; override;
  28.     function GetState: TExpertState; override;
  29.     function GetIDString: string; override;
  30.     procedure Execute; override;
  31.   end;
  32.  
  33. { TPropExplorerExpert -------------------------------------------------------- }
  34.  
  35. { Return the name of the property explorer expert }
  36. function TPropExplorerExpert.GetName: string;
  37. begin
  38.   Result := 'Property Explorer';
  39. end;
  40.  
  41. { Return the text to appear on the menu }
  42. function TPropExplorerExpert.GetMenuText: string;
  43. begin
  44.   Result := 'Property E&xplorer...';
  45. end;
  46.  
  47. { Return the style of the expert - standard - add to Help menu }
  48. function TPropExplorerExpert.GetStyle: TExpertStyle;
  49. begin
  50.   Result := esStandard;
  51. end;
  52.  
  53. { Return the expert's state }
  54. function TPropExplorerExpert.GetState: TExpertState;
  55. begin
  56.   Result := [esEnabled];
  57. end;
  58.  
  59. { Return a unique id for the expert }
  60. function TPropExplorerExpert.GetIDString: string;
  61. begin
  62.   Result := 'KWood.PropertyExplorer';
  63. end;
  64.  
  65. { And invoke the expert }
  66. procedure TPropExplorerExpert.Execute;
  67. begin
  68.   try
  69.     PropExplorerExpert;
  70.   except
  71.     ToolServices.RaiseException(ReleaseException);
  72.   end;
  73. end;
  74.  
  75. { Experts interface ---------------------------------------------------------- }
  76.  
  77. { Tidy up }
  78. procedure DoneExpert; export;
  79. begin
  80.   { Put any general destruction code here.  Note that the Delphi IDE
  81.     will destroy any experts which have been registered. }
  82. end;
  83.  
  84. { Initialise the expert and register it with Delphi }
  85. function InitExpert(ToolServices: TIToolServices;
  86.   RegisterProc: TExpertRegisterProc;
  87.   var Terminate: TExpertTerminateProc): Boolean; export; stdcall;
  88. begin
  89.   { Make sure we're the first and only instance }
  90.   Result := (ExptIntf.ToolServices = nil);
  91.   if not Result then
  92.     Exit;
  93.  
  94.   ExptIntf.ToolServices := ToolServices;
  95.   if ToolServices <> nil then
  96.     Application.Handle := ToolServices.GetParentHandle;
  97.  
  98.   Terminate := DoneExpert;
  99.  
  100.   { Register the expert }
  101.   RegisterProc(TPropExplorerExpert.Create);
  102. end;
  103.  
  104. { Export the required functions for external use }
  105. exports
  106.   InitExpert name ExpertEntryPoint resident;
  107.  
  108. begin
  109. end.
  110.